use crate::base::{
    client::Client,
    params::{GetBlockByNumParams, GetNowBlockParams},
    response::block::Block,
};

pub async fn get_block_by_num(client: &Client, num: u64) -> anyhow::Result<Block> {
    client
        .post("/wallet/getblockbynum", GetBlockByNumParams::new(num))
        .await
}

pub async fn get_now_block(client: &Client) -> anyhow::Result<Block> {
    client
        .post("/wallet/getnowblock", GetNowBlockParams::new())
        .await
}
